<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<script type="text/javascript" src="./js/jquery-1.11.3.js"></script>
<script type="text/javascript">
	function Request(strName) { 
		var strHref = window.document.location.href; 
		var intPos = strHref.indexOf("?"); 
		var strRight = strHref.substr(intPos + 1); 
		var arrTmp = strRight.split("&"); 
		for(var i = 0; i < arrTmp.length; i++) { 
			var arrTemp = arrTmp[i].split("="); 
			if(arrTemp[0].toUpperCase() == strName.toUpperCase()) return arrTemp[1]; 
		} 
		return ""; 
	}
	$(function(){
		var id = Request("id");
		$.ajax({
			url : "json/getMenu.action",
			type : "POST",
			contentType : "application/json",
			data : '{"id":"'+id+'"}',
			dataType : "json",
			success: function(data){
				var dataResult = data["dataResult"];
				var menu = dataResult.result;
				document.getElementById("id").value=menu.id;
				document.getElementById("orderid").value=menu.orderid;
				document.getElementById("no").value=menu.no;
				document.getElementById("name").value=menu.name;
				document.getElementById("price").value=menu.price;
				document.getElementById("intro").value=menu.intro;
				document.getElementById("photo").value=menu.photo;
			},
			error: function(data){
			}
		});
	})
</script>
<style type="text/css">
input{
	width: 500px;
}
</style>
</head>
<body>
	<form action="editMenu.action" method="POST" enctype="multipart/form-data">
		<input type="hidden" name="menu.id" id="id">
		排序：<input type="text" name="menu.orderid" id="orderid"><br>
		菜品编号：<input type="text" name="menu.no" id="no"><br>
		名字：<input type="text" name="menu.name" id="name"><br>
		价格：<input type="text" name="menu.price" id="price"><br>
		介绍：<input type="text" name="menu.intro" id="intro"><br>
		图片：<input type="text" name="menu.photo" id="photo">
		<input type="file" name="photo"><br>
		<input type="submit" value="提交">
	</form>
</body>
</html>
